package com.jiuling.qiniu.config;

/**
 * 七牛云配置
 * @author 紫灵
 * @date 2023年05月23日 09时45分24秒
 */
public class QiNiuConfig {

    /** 存取键 */
    private String accessKey;
    /** 密钥 */
    private String secretKey;

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    /**
     * 建造者
     * @return 建造者对象
     */
    public static Builder builder(){
        return new Builder();
    }

    /** 建造者 */
    public static class Builder{
        private final QiNiuConfig qiNiuConfig;

        public Builder() {
            this.qiNiuConfig = new QiNiuConfig();
        }

        /**
         * 添加存取件
         * @param accessKey 存取键
         * @return 建造者
         */
        public Builder addAccessKey(String accessKey){
            qiNiuConfig.accessKey = accessKey;
            return this;
        }

        /**
         * 添加密钥
         * @param secretKey 密钥
         * @return 建造者
         */
        public Builder addSecretKey(String secretKey){
            qiNiuConfig.secretKey = secretKey;
            return this;
        }

        /**
         * 建造
         * @return 七牛云配置
         */
        public QiNiuConfig build() {
            return qiNiuConfig;
        }
    }
}
